import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter)

import Mobile from '@/view/Mobile.vue';
	import MobileHome from '@/view/mobile/MobileHome.vue';
	import MobileHeader from '@/components/mobile/default/MobileHeader.vue';
	import MobileFooter from '@/components/mobile/default/MobileFooter.vue';
	import MobileBooksList from '@/view/mobile/MobileBooksList.vue'
	import MobileBookDetail from '../view/mobile/MobileBookDetail.vue'
	import MobileSearch from '../view/mobile/MobileSearch.vue'
	import My from '@/view/mobile/My.vue'
	import MobileDd from '@/components/mobile/my/MobileDd.vue'
	import MobileGwc from '@/components/mobile/my/MobileGwc.vue'
	import MobileLogin from '@/components/mobile/my/MobileLogin.vue'
	import MobileSc from '@/components/mobile/my/MobileSc.vue'
	// import MobileLogin from '../view/mobile/my/MobileLogin.vue'
	// import MobileOrdid from '../view/mobile/my/MobileMyOrdid.vue'
	// import MobileCart from '../view/mobile/my/MobileMyCart.vue'
import Pc from '../view/pc.vue';
	import PcHome from '@/view/pc/Home.vue';
	import PcFooter from '../components/pc/default/PcFooter.vue';
	import PcHeader from '../components/pc/default/PcHeader.vue';
	import PcSlide from '@/components/pc/default/PcSlide.vue';
	import PcZc from '@/components/pc/my/PcZc.vue';
	import MyXx from '@/components/pc/my/MyXx.vue';
	import PcGwc from '@/components/pc/my/PcGwc.vue';
	import PcDd from '@/components/pc/my/PcDd.vue'
	import PcBookDetail from '@/view/pc/PcBookDetail.vue';
	import PcUpdatePas from '@/components/pc/my/PcUpdatePas.vue';
	// import BookHot from '@/components/pc/hot/BookHot.vue';
	
import Admin from '../view/adm.vue';
	import PcAdm from '../view/pc/adm.vue';
	import PcAdmHeader from '../components/pc/adm/PcAdmHeader.vue'
	import PcAdmFooter from '../components/pc/adm/PcAdmFooter.vue';
	import PcHot from '../components/pc/adm/hot/findHot.vue';
	import PcAddHot from '../components/pc/adm/hot/addHot.vue';
	import PcUpdateHot from '../components/pc/adm/hot/updateHot.vue';
	import PcFirstType from '../components/pc/adm/booktype/Firstleveltype.vue';
	import PcSecondType from '../components/pc/adm/booktype/Secondleveltype.vue';
	import PcGoods from '../components/pc/adm/goods/Goods.vue';
	import PcAddGoods from '../components/pc/adm/goods/addGood.vue';
const routes = [{
		path: '/',
		// redirect:{
		// 	name:'PcHome'
		// }
		// redirect:'/mobile/home'
		redirect: '/pc/home'
	},
	{
		path: '/mobile',
		name: 'Mobile',
		component: Mobile,
		children: [{
				path: 'home',
				name: 'MobileHome',
				//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
				components: {
					default: MobileHome, //渲染到没有name属性的router-view上
					header: MobileHeader,
					footer: MobileFooter,
				}
			},
			{
				path: 'login',
				name: 'MobileLogin',
				components: {
					default:MobileLogin, //渲染到没有name属性的router-view上
					header: MobileHeader,
					footer: MobileFooter,
				}
			},
			{
				path: 'bookslist',
				name: 'MobileBooksList',
				components: {
					default: MobileBooksList, //渲染到没有name属性的router-view上
					header: MobileHeader,
					footer: MobileFooter,
				}
			},
			{
				path : 'my',
				name : 'My',
				components: {
					default: My, //渲染到没有name属性的router-view上
					header: MobileHeader,
					footer: MobileFooter,
				}
			},
			{
				path: 'dd',
				name: 'MobileDd',
				components: {
					default: MobileDd, //渲染到没有name属性的router-view上
					header: MobileHeader,
					footer: MobileFooter,
				}
			},
			{
				path: 'gwc',
				name: 'MobileGwc',
				components: {
					default: MobileGwc, //渲染到没有name属性的router-view上
					header: MobileHeader,
					footer: MobileFooter,
				}
			},
			{
				path: 'sc',
				name: 'MobileSc',
				components: {
					default: MobileSc, //渲染到没有name属性的router-view上
					header: MobileHeader,
					footer: MobileFooter,
				}
			},
			{
				path: 'bookdetail/:bookid',
				name: 'MobileBookDetail',
				component: MobileBookDetail
			},
			{
				path: 'search',
				name: 'MobileSearch',
				component: MobileSearch
			}
		],
	},
	{
		path: '/pc',
		name: 'Pc',
		component: Pc,
		children: [
			{
			path: 'home',
			name: 'PcHome',
			//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
			components: {
				default: PcHome, //渲染到没有name属性的router-view上
				pcheader: PcHeader,
				pcfooter: PcFooter,
			}
		},
		{
			path : 'zc',
			name : 'PcZc',
			components : {
				default : PcZc,
				pcheader: PcHeader,
				pcfooter: PcFooter,
			}
		},
		{
			path : 'myxx',
			name : 'MyXx',
			components : {
				default : MyXx,
				pcheader: PcHeader,
				pcfooter: PcFooter,
			}
		},
		{
			path : 'gwc',
			name : 'PcGwc',
			components : {
				default : PcGwc,
				pcheader: PcHeader,
				pcfooter: PcFooter,
			}
		},
		{
			path : 'dd',
			name : 'PcDd',
			components : {
				default : PcDd,
				pcheader: PcHeader,
				pcfooter: PcFooter,
			}
		},
		{
			path: 'bookdetail/:bookid',
			name: 'PcBookDetail',
			components: {
				default : PcBookDetail,
				pcheader: PcHeader,
				pcfooter: PcFooter,
			}
		},
		// {
		// 	path : 'updatepas',
		// 	name : 'PcUdatePas',
		// 	components : {
		// 		default : PcUpdatePas,
		// 		pcheader: PcHeader,
		// 		pcfooter: MyXx,
		// 	}
		// }
		// {
		// 	path: 'adm',
		// 	name: 'PcAdm',
		// 	//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
		// 	components: {
		// 		default: PcAdm, //渲染到没有name属性的router-view上
		// 		pcheader: PcAdmHeader,
		// 		pcfooter:PcAdmFooter
		// 	}
		// },
		// {
		// 	path: 'img',
		// 	name: 'PcAdmImg',
		// 	//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
		// 	components: {
		// 		default: PcHot, //渲染到没有name属性的router-view上
		// 		pcheader: PcAdmHeader,
		// 		pcfooter:PcAdmFooter
		// 	}
		// },
		 ]
	},
	
	{
		path: '/adm',
		name: 'PcAdm',
		component: Admin,
		children: [
		{
			path: 'img',
			name: 'PcAdmImg',
			//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
			components: {
				default: PcHot, //渲染到没有name属性的router-view上
				pcAdmheader: PcAdmHeader,
				pcAdmfooter:PcAdmFooter
			}
		},
		{
			path: 'addhot',
			name: 'PcAddAdmHot',
			//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
			components: {
				default: PcAddHot, //渲染到没有name属性的router-view上
				pcAdmheader: PcAdmHeader,
				pcAdmfooter:PcAdmFooter
			}
		},
		{
			path: 'updatehot',
			name: 'PcUpdateAdmHot',
			//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
			components: {
				default: PcUpdateHot, //渲染到没有name属性的router-view上
				pcAdmheader: PcAdmHeader,
				pcAdmfooter:PcAdmFooter
			}
		},
		{
			path: 'onetype',
			name: 'Firstleveltype',
			//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
			components: {
				default: PcFirstType, //渲染到没有name属性的router-view上
				pcAdmheader: PcAdmHeader,
				pcAdmfooter:PcAdmFooter
			}
		},
		{
			path: 'twotype',
			name: 'Secondleveltype',
			//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
			components: {
				default: PcSecondType, //渲染到没有name属性的router-view上
				pcAdmheader: PcAdmHeader,
				pcAdmfooter:PcAdmFooter
			}
		},
		{
			path: 'goods',
			name: 'Goods',
			//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
			components: {
				default: PcGoods, //渲染到没有name属性的router-view上
				pcAdmheader: PcAdmHeader,
				pcAdmfooter:PcAdmFooter
			}
		},
		{
			path: 'addgoods',
			name: 'AddGoods',
			//下面所使用的是：命名视图的方式，为router-view的name属性匹配组件
			components: {
				default: PcAddGoods, //渲染到没有name属性的router-view上
				pcAdmheader: PcAdmHeader,
				pcAdmfooter:PcAdmFooter
			}
		},
		 ]
	}
];

const router = new VueRouter({
	routes,
})
export default router;
